import 'dart:typed_data';

import 'package:plugin_platform_interface/plugin_platform_interface.dart';

import 'pos_link_print_method_channel.dart';

abstract class PosLinkPrintPlatform extends PlatformInterface {
  /// Constructs a PosLinkPrintPlatform.
  PosLinkPrintPlatform() : super(token: _token);

  static final Object _token = Object();

  static PosLinkPrintPlatform _instance = MethodChannelPosLinkPrint();

  /// The default instance of [PosLinkPrintPlatform] to use.
  ///
  /// Defaults to [MethodChannelPosLinkPrint].
  static PosLinkPrintPlatform get instance => _instance;

  /// Platform-specific implementations should set this with their own
  /// platform-specific class that extends [PosLinkPrintPlatform] when
  /// they register themselves.
  static set instance(PosLinkPrintPlatform instance) {
    PlatformInterface.verifyToken(instance, _token);
    _instance = instance;
  }

  Future<String?> getPlatformVersion() {
    throw UnimplementedError('platformVersion() has not been implemented.');
  }

  /*
  清空打印机缓存
   */
  Future<void> clear() async {
    _instance.clear();
  }
  /*
  左对齐
   */
  Future<void> leftAlign() async {
    _instance.leftAlign();
  }
  /*
  右对齐
   */
  Future<void> rightAlign() async {
    _instance.rightAlign();
  }
  /*
  居中对齐
   */
  Future<void> centerAlign() async {
    _instance.centerAlign();
  }
  /*
  设置文字
   */
  Future<void> content(String content) async {
    _instance.content(content);
  }
  /*
  二维码 条形码
  type 条形码类型
  blockSize 条形码大小
  content 条形码内容
   */
  Future<void> barcode(int type,int blockSize,String content) async {
    _instance.barcode(type,blockSize,content);
  }
  /*
  小字体
   */
  Future<void> smallFont() async {
    _instance.smallFont();
  }
  /*
  正常的字体
   */
  Future<void> normalFont() async {
    _instance.normalFont();
  }
  /*
  大字体
   */
  Future<void> bigFont() async {
    _instance.bigFont();
  }
  /*
  页头分割线
   */
  Future<void> header() async {
    _instance.header();
  }
  /*
  页脚分割线
   */
  Future<void> trailer() async {
    _instance.trailer();
  }
  /*
  免责声明
   */
  Future<void> disclaimer() async {
    _instance.disclaimer();
  }
  /*
  日期
   */
  Future<void> date() async {
    _instance.date();
  }
  /*
  时间
   */
  Future<void> time() async {
    _instance.time();
  }
  /*
  sn
   */
  Future<void> sn() async {
    _instance.sn();
  }
  /*
  invert
   */
  Future<void> invert() async {
    _instance.invert();
  }
  /*
  行分隔符
   */
  Future<void> lineSeparator() async {
    _instance.lineSeparator();
  }
  /*
  打印
   */
  Future<void> print() async {
    _instance.print();
  }
  /*
  打印图片
  imgStr 图片信息
  location 位置 0 左 1 中 2 右
   */
  Future<void> printImg(Uint8List bytes,int location) async {
    _instance.printImg(bytes,location);
  }

}
